# # from app.order.sale.abs_model import SaleOrder
# from app.order.sale.model import SaleOrder as SaleOrderTable
# from exts import db
# from app.order.sale import dao
# from common.utils.utils import custom_marshal_pagination
#
#
# def create(user_id, order_skus_json, **kwargs):
#     """"""
#     sale_order = SaleOrder()
#     return sale_order.create_order(user_id, order_skus_json, **kwargs)
#
#
# def get_by_page(user_id, **kwargs):
#     pagination = dao.get_by_page(**kwargs)
#     pagination = custom_marshal_pagination(pagination)
#     return pagination
#
#
# def get(user_id, obj_id):
#     return SaleOrderTable.query.filter_by(id=obj_id).first()
#
#
# def save_draft(user_id, order_id, order_skus_json, **kwargs):
#     """"""
#     sale_order = SaleOrder(order_id, user_id)
#     sale_order.save_draft(order_skus_json, **kwargs)
#     return sale_order.order_table
#
#
# def submit(user_id, order_id, order_skus_json, **kwargs):
#     sale_order = SaleOrder(order_id, user_id)
#     sale_order.save_draft(order_skus_json, **kwargs)
#     sale_order.submit()
#     return sale_order.order_table
#
#
# def revoke(user_id, order_id):
#     sale_order = SaleOrder(order_id, user_id)
#     sale_order.revoke()
#     return sale_order.order_table
#
#
# def delete(user_id, obj_id):
#     obj = SaleOrder.query.filter_by(id=obj_id).first()
#     db.session.delete(obj)
#     db.session.commit()
#     return obj.id
